﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title>应用管理</title>
<script src="jquery-1.8.3.js"></script>
</head>
<body>
<a href="javascript:;" class="music">安装音乐(Music)</a>
<a href="javascript:;" class="uninstall_music">卸载音乐(Music)</a>
</body>
</html>
<script>
    var music = { appid: 7, icon: 'pngs/music.png', name: '音乐', src: 'music.html' };
    $('a.music').click(function () {
        if (parentWindow.api.test(music)) {
            alert('已经安装了' + music.name);
        } else {
            //if (confirm('确定安装' + music.name + '？'))
                parentWindow.api.install(music);
        }
    });
    $('a.uninstall_music').click(function () {
        if (!parentWindow.api.test(music)) {
            alert('没有安装' + music.name);
        } else {
            //if (confirm('确定卸载' + music.name + '？'))
                parentWindow.api.uninstall(music);
        }
    });
</script>
